package com.authine.cloudpivot.ext.enums;
/**
 * 财物车商品来源
 * author Ivan.Zhao
 */
public enum CartSrcEnum {

    ALL(0, "全部"),
    MARKET(1, "市场"), //无价格
    SHOP(2, "商城"),
    SINGLE(3, "单次"), // 询价单次采购
    LOOP(4, "循环"), // 询价循环采购
    CONTRACT(5, "代购"),
    VMI(6, "VMI"), // VMI
    EnterpriseMall(7,"客户企业商城"),
    ExternalMall(8,"外部商城");

    public Integer id;
    public String text;

    CartSrcEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static CartSrcEnum get(Object id) {
        if (id == null) {
            return null;
        }

        for (CartSrcEnum c : CartSrcEnum.values()) {
            if (String.valueOf(id).equals(String.valueOf(c.id))) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}